sql server 问题,我用的是sql server 2005答:这事用row_number来解决最方便。--测试数据create table tt7(id int , [type] varchar(10), [time] datetime);insert into tt7select 1,'A','2012-01-01' union allselect 2,'A','2012-02-01' union allselect 3,'B','2012-01-02' union allselect 4,'B','2012-02-01' select ...